<?php
  header('Content-Type:text/html;charset=utf-8');
  $username=$_POST['username'];
  $password=$_POST['password'];
  require_once 'class.php';
  PDOc::_connect();
  PDOc::login($username,$password);
  /*
  $pdo=new PDO('mysql:host=localhost;dbname=dtb','root','');
    if (($username<>'') AND ($password<>'')) {
    	$pdo=new PDO('mysql:host=localhost;dbname=dtb','root','');
    	$sql="SELECT * FROM user WHERE username = '{$username}'AND password='{$password}'";
    	$stmt=$pdo->query($sql);
    	//echo !$stmt->rowCount()==0?'exists.':'not exists.';
    	if ($stmt->rowCount()==0) {
    		echo '账号或者密码错误，请重新确认后再次登录。'.'<br/>';
    		unset($username); unset($password);
    		echo '<a href="login.php"><input value="返回登录" type="button"></a>';
    	} else {
    		echo "成功登录！".'<br/>';
    		echo '<a href="userIndex.php"><input value="进入主页" type="button"></a>';
    	}
    } else {
    	echo '文本框请勿留空！'.'<br/>';
    	unset($username); unset($password);
    	echo '<a href="login.php"><input value="返回登录" type="button"></a>';
    }
    */
?>